package com.wink_172.library.adapter

import androidx.fragment.app.Fragment
import androidx.fragment.app.FragmentActivity
import androidx.viewpager2.adapter.FragmentStateAdapter
import com.wink_172.library.fragment.BaseFragment

/**
 * @author: fcg
 * @date: 2020-11-03
 * Description:
 */
open class CustomViewPagerAdapter(fragmentActivity: FragmentActivity, val mList: List<String>,
                             val mBaseFragments: List<BaseFragment>) : FragmentStateAdapter(fragmentActivity) {
    override fun createFragment(position: Int): Fragment {
//      int index = position % mList.size();
        return mBaseFragments[position]
    }

    override fun getItemCount(): Int {
        return mBaseFragments.size
    }
}